<template>
    <div class="teamTabs text-black-pk">
        <van-tabs v-model="groupActive"
                  @click="handleTabs"
                  title-active-color="#D82D11"
                  line-height="0"
                  :swipe-threshold="5"
                  background="#FFFFFF">
            <van-tab title="全部" name="0"></van-tab>
            <van-tab title="拼团中" name="1"></van-tab>
            <van-tab title="拼团成功" name="2"></van-tab>
            <van-tab title="拼团失败" name="3"></van-tab>
        </van-tabs>
    </div>
</template>
<script>
    export default {
        name:'groupTabs',
        data(){
            return{
                groupActive:0,
                groupStatus:""
            }

        },
        methods:{
            handleTabs() {
                this.getStatus();
                this.$emit("change", this.groupStatus)
            },
            /* groupStatus： 0=拼团中，1=拼团成功，2=拼团失败,3未成团*/
            getStatus(){
                switch (this.groupActive) {
                    case "0":
                        this.groupStatus = "";
                        break;
                    case "1":
                        this.groupStatus =0;
                        break;
                    case "2":
                        this.groupStatus = 1;
                        break;
                    case "3":
                        this.groupStatus = 2;
                        break;
                }
            }
        }
    }
</script>
<style lang="scss" scoped>
    .teamTabs {
        background-color: #FFFFFF;
        position: fixed;
        z-index: 1030;
        top: 45px;
        right: 0;
        left: 0;
    }
</style>
